package Test;

class Person {
    protected String name;
    protected String gender;
    protected int age;

    public Person() {

    }

    public Person(String name, String gender, int age) {
        this.name = name;
        this.gender = gender;
        this.age = age;
    }

    public void show() {
        System.out.println("Person");
        System.out.println("name: " + this.name);
        System.out.println("gender: " + this.gender);
        System.out.println("age: " + this.age);
        System.out.println();
    }
}

class Teacher extends Person {
1
    public Teacher() {
        super();
    }

    public Teacher(String name, String gender, int age) {
        super(name, gender, age);
        this.name = name;
        this.gender = gender;
        this.age = age;
    }

    @Override
    public void show() {
        System.out.println("Teacher");
        System.out.println("name: " + this.name);
        System.out.println("gender: " + this.gender);
        System.out.println("age: " + this.age);
        System.out.println();
    }
}


public class Public {

    public static void show(Person p) {
        p.show();
    }

    public static void main(String[] args) {
        Person p = new Person("zhangsan", "man", 12);
        Teacher t = new Teacher("Lisi", "man", 18);
        show(p);
        show(t);
    }
}
